//-----------------Sonic CD Fire Gun Script-------------------//
//------------------Scripted by makasinaaaa-------------------//
// Yeah...

// Aliases
#alias Object.Value0	:	Object.Timer
#alias Object.Value1	:	Object.Timer2
#alias Object[24].PropertyValue	:	HUD.CurrentTimePeriod

sub ObjectMain
	Object.DrawOrder =  4
	Object.Timer2 = Object.PropertyValue
	Object.Timer2 *= 30
	Object.Timer++
	if Object.Timer == Object.Timer2
		Object.Timer = 0
			PlayStageSFX(6, false)
			TempValue1  = Object.XPos
			TempValue1 -= 0x00000

			TempValue2  = Object.YPos
			TempValue2 -= 0x100000
			CreateTempObject(TypeName[FireBall], TempValue0, TempValue1, TempValue2)
			Object[TempObjectPos].DrawOrder =  3
			Object[TempObjectPos].PropertyValue =  0
			TempValue0++
	end if
end sub

sub ObjectDraw
	DrawSprite(0)
end sub

sub ObjectStartup
	LoadSpriteSheet("R2/Objects2.gif")

	TempValue0 = HUD.CurrentTimePeriod
	TempValue1 = 1
	TempValue0 *= 33
	TempValue1 += TempValue0 
	SpriteFrame(-16, -4, 32, 9, TempValue1, 99)
end sub